<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>更新岗位薪资</title>
    <link rel="stylesheet" href="../../dist/css/layui.css">
    <script src="../../dist/layui.js"></script>
</head>
<body>

<div style="text-align: center">
    <p>现工资：<span style="color: #5FB878">${param.salary}</span></p>
</div>
<br/>
<hr class="layui-border-orange">
<form class="layui-form">
    <!-- 电话 -->
    <div class="layui-form-item" style="width: 300px">
        <label class="layui-form-label">新工资：</label>
        <div class="layui-input-block">
            <input type="text" name="newSalary" required  lay-verify="required" placeholder="请输入新的工资" autocomplete="off" class="layui-input">
        </div>
    </div>

    <input type="text" name="id" value="${param.id}" hidden>

    <!-- 提交 -->
    <div style="margin-top: 30px">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal layui-block" id="submitBtn" lay-submit>提交</button>
        </div>
    </div>
</form>
<script>
    layui.use(['layer', 'form'], function(){
        var layer = layui.layer
            ,form = layui.form
            ,$ = layui.jquery;

        form.on('submit()',function(data){

            $.ajax({
                url:'/admin/updateJobSalaryById',
                async: false,
                type:'post',
                data:data.field,
                dataType:'JSON',
                success:function(result){
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    // 关闭父级弹出层
                    parent.layer.close(index);
                    parent.parent.layer.msg("修改成功！",{icon:1,time:1000});
                    // 刷新父页面
                    parent.location.reload();
                }
            });
            return false;//组织表单默认提交并跳转
        });

    });
</script>
</body>
</html>
